from typing import Any, Dict, List, Optional, TypedDict


# 人脸特征提取结果
class FaceFeature(TypedDict):
    face_id: int
    bbox: List[int]
    landmark: Optional[List[List[float]]]
    embedding_dimension: Optional[int]
    embedding: Optional[List[float]]
    gender: Optional[int]
    age: Optional[int]


# 批量人脸特征提取参数
class BatchExtractFaceFeaturesParam(TypedDict):
    image_name: str
    image_base64: str


# 批量人脸特征提取结果对应图片
class BatchImageResult(TypedDict):
    image_index: int
    image_name: str
    success: bool
    error: Optional[str]
    face_count: Optional[int]
    features: List[Dict[str, Any]]


# 批量人脸特征处理结果
class BatchProcessResult(TypedDict):
    total: int
    success_count: int
    failed_count: int
    results: List[BatchImageResult]

# 人脸特征提取算法
ValidMetrics: List[str] = ["cosine", "euclidean", "euclidean_l2"]
